<?php
namespace Application\Controller;

use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
//use Application\Model\User;
//use User\Form\UserForm;

class UserController extends AbstractActionController
{
    protected $userTable;

    public function getUserTable()
    {
        if (!$this->userTable) {
            $sm = $this->getServiceLocator();
            $this->userTable = $sm->get('Application\Model\UserTable');
        }
        return $this->userTable;
    }

    public function indexAction()
    {var_dump('indexAction');exit;
        //var_dump($this->getUserTable()->fetchAll()->current());exit();
        return new ViewModel(array(
            'user' => $this->getUserTable()->fetchAll(),
        ));
    }
}